#include <iostream>

using std::cout;
using std::endl;

///////////////////////////////////////////////////////////////////////////////
class Foo
{
public:
	Foo(){ cout << "Foo Constructor" << endl; }
};

class Bar
{
public:

private:
	Foo _foo;
};

//class has object member,compiler generate 'default constructor'
void ObjectMem()
{
	Bar bar;
}

///////////////////////////////////////////////////////////////////////////////
class Bara
{
public:
	Bara():_val(0){}
private:
	int _val;
	Foo _foo;
};

//Even class has defined 'default constructor',compiler will insert  
//CALL_BASE_CALSS_DEFAULT_CONSTRUCTOR code into 'default constructor'
void ObjectMemWithExistedDefaultConstructor()
{
	Bara bara;
}

///////////////////////////////////////////////////////////////////////////////
class Bard :public Foo
{
public:
};

//Base has 'default constructor',compiler generate 'default constructor' for derived class to call
// 'base class default constructor'
void BaseHasDefaultConstructor()
{	
	Bard bard;
}

///////////////////////////////////////////////////////////////////////////////

int main()
{
	BaseHasDefaultConstructor();
}
